/********************************************************************************
* Project       : No Latency RTSP streaming Project
* Author        : Seo, SeokWon 
* e-mail        : kueony@gmail.com
* Licence       : See the Copyright
*********************************************************************************/

#ifndef  ___LIB_NETWORK_H___
#define  ___LIB_NETWORK_H___

#define SOCKET_ALL_CLOSE(x) { shutdown(x, 2); close(x); x = -1; }

extern int MakeSocketAndConnect(char* a_pcAddr, int a_iPort);
extern int MakeSocketAndConnectUDP(char* a_pcAddr, int a_iPort);
extern int MakeMulticastSocket(unsigned long a_ulAddr, int a_iPort);
extern int MakeServerSocket(char* a_pcAddr, int a_iPort);
extern int MakeServerSocketUDP(char* a_pcAddr, int a_iPort);

extern int SendMsg4FixSize(int a_iSock, char* a_pcData, int a_iSize);
extern int RecvMsg4FixSize(int a_iSock, char* a_pcData, int a_iSize);
extern int SendMsg4FixSizeTimeOut(int a_iSock, char* a_pcData, int a_iSize, unsigned int a_uiSec);
extern int RecvMsg4FixSizeTimeOut(int a_iSock, char* a_pcData, int a_iSize, unsigned int a_uiSec);
	 
extern int RequestHttpPage(char* a_pcAddr, char* a_pcPage, int a_iPort);
extern int RequestHttpData(char *a_pcAddr, char *a_pcPage, int a_iPort, unsigned int* a_puiSize);
	

extern int SetSockTime(int a_iSock, int a_iSec);
	 

#endif// ___LIB_NETWORK_H___

